package com.kaver.core.common.constant.state;

/**
 * 配置的状态
 *
 * @author Roc
 * @Date 2017年1月22日 下午12:14:59
 */
public enum ConfigStatus {
	NEW(0, "新增"), 
	UPD(1, "更新未发布"), 
	DEL(2, "删除"), 
	PUB(3, "发布中");

	Integer code;
	String message;

	ConfigStatus(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public static String valueOf(Integer status) {
		if (status == null) {
			return "";
		} else {
			for (ConfigStatus s : ConfigStatus.values()) {
				if (s.getCode() == status) {
					return s.getMessage();
				}
			}
			return "";
		}
	}
}
